﻿<%@ page language="java" contentType="text/html; charset=utf-8" pageEncoding="utf-8"%>
<%  String path = request.getContextPath();
    HttpSession userInfo=request.getSession();
%> 
<!DOCTYPE html>
<html>
<head>
<title>登录</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta http-equiv="Content-Language" content="zh-CN" />
<link href="<%=path%>/resources/css/pages/style.css" rel="stylesheet" type="text/css" />
<script type="text/javascript" src="<%=path%>/resources/script/js/jquery-1.8.0.min.js" ></script>
<jsp:include page="/WEB-INF/views/common.jsp"></jsp:include>
<script src="<%=path%>/resources/script/js/vue.js"></script>
<script type="text/javascript" src="<%=path%>/resources/script/js/js.js" ></script>
</head>
<body>
<div id="contentBody">
<div class="top">
  <div class="top-ct">
    <h3 class="logo"></h3> 
      <span id='span'>
       <a href="<%=path%>/pages/login" id='plogin'><span >您好，请登录！</span></a>
       <a href="<%=path%>/pages/userInfo?userid=${loginUser.id}" id='pshow'><span></span></a>
    </span>
    <p><a href="<%=path%>/index" class="select">首页</a><a href="<%=path%>/pages/mycourse?userid=${loginUser.id}">我的课程</a>
	<a href="<%=path%>/pages/learnhistory?userid=${loginUser.id}">学习历史</a><a href="javascript:void(0);">我的技能</a>
</p> 
    </div>
</div>
<div class="ny-login">
  <div class="login-ct">
	  <form id="form" method="post">
		  <p>公共场所不建议保存账号，以防丢失。</p>
		   <label><input type="text" class="yym" name="j_username" id="account" placeholder="输入用户账号"></label>
		   <label><input type="password" id="password" onchange="pwdchange()" placeholder="输入用户密码" class="mm" name="j_password"></label>
		   <label id="msg"></label>
		   <label class="jzmm"> <span><input type="checkbox" name="j_password"> &nbsp;记住用户名</span>  <a href="<%=path%>/pages/changpwd">忘记密码?</a></label>
		   <label> <input id="logining" type="button" class="tjan" value=""></label>
		   <p class="zcx"><a id="register">注册新账号</a></p> 
	  </form>
  </div>
</div>
<div class="foot-ct1"><p>Copyright © 2016 业主单位：福建工程学院，建设单位：福州森泽信息科技有限公司 技术服务热线：87862229
</p></div>
<div class="clear"></div>

<script type="text/javascript">
	$(function(){ 
		$('#account').validatebox({    
	 		   required: true,    
	 		   missingMessage:'输入用户名'   
	 		});  
	 		$('#password').validatebox({    
		 		required: true,    
		 		missingMessage:'输入密码'   
		 	});
		$('#logining').click(function() {
			$('#form').ajaxSubmit({
				url : '<%=path%>' + '/pages/j_spring_security_check',
				success : function(result) {
				if (!result.success) {
					//$.messager.alert('提醒', data.message,'info');
					var html = '&nbsp; &nbsp;&nbsp; &nbsp;<font color="red">' + result.message +'</font>';
					$('#msg').html(html);
				} else {
					$('#msg').html("");
					location.href = '<%=path%>' + result.data;
					}
				}
			});
		}); 
		
		$('#register').click(function() {
			location.href = '<%=path%>' + '/pages/registerView';
		});
});
	
	function pwdchange()
	{
		$('#msg').html("");
	}
</script>
</div>
</body>
</html>
